<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
  <title>make_select (CrudMaker)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
</head>
<body class="standalone-code">
  <pre><span class="ruby-comment cmt"># File lib/CrudMaker.rb, line 49</span>
  <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">make_select</span>
    <span class="ruby-identifier">select_template</span> = <span class="ruby-value str">'SELECT * INTO #{rec_name} FROM #{table_name} WHERE #{where_clause};'</span>
    <span class="ruby-identifier">rec_name</span> = <span class="ruby-value str">&quot;the&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@table_name</span>.<span class="ruby-identifier">capitalize</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;Rec&quot;</span>
    <span class="ruby-identifier">where_clause</span> = <span class="ruby-ivar">@primary_key</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot; = &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@table_name</span>.<span class="ruby-identifier">capitalize</span> <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;Rec.&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@primary_key</span>
    <span class="ruby-ivar">@select_sql</span> = <span class="ruby-identifier">eval</span>( <span class="ruby-value str">'&quot;'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">select_template</span> <span class="ruby-operator">+</span> <span class="ruby-value str">'&quot;'</span> )
  <span class="ruby-keyword kw">end</span></pre>
</body>
</html>